package com.qfedu.dao;

import com.qfedu.entity.TQuestion;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TQuestionDao {

    /**
     * 添加笔记
     * @param
     * @return
     */
    @Insert("insert into t_question(question,answer,u_no) values(#{question}, #{answer},#{u_no})")
    int addQuestionNote(TQuestion tQuestion);

    /**
     * 添加代码
     * @param
     * @param
     * @return
     */
    @Insert("insert into t_question(question,answer , u_no) values(#{question}, #{answer}, #{u_no})")
    int addQuestionCode(TQuestion tQuestion);

    /**
     * 新增资源
     * @param tQuestion
     * @return
     */
    @Insert("insert into t_question(question, answer, qtype, star, flag) values(#{question}, #{answer}, #{qtype}, #{star}, #{flag})")
    int addQuestion(TQuestion tQuestion);

    /**
     *  资源库
     * @return
     */
    @Select("selet * from t_question")
    List<TQuestion> getAllQuestion();

}
